var mysql = require('mysql');
var connection = mysql.createConnection({
    'host':'localhost',
    'user':'root',
    'password':'root',
    'database':'test'
});

connection.connect();

connection.query('select * from newcm_goodsales limit 10',function(err,rows,fields) {
    if(err) {
        throw err;
    }
    console.log('结果是：',rows[0]);
});

connection.end();